package cn.gok.yufa;

public class 运算符 {
    public static void main(String[] args) {
        //test();
        test1();
    }
    private static void test(){
        //赋值运算
        int i,j,k;
        i = j = k = 10;
        int x;
        System.out.println(x=100);
        System.out.println(x == 100);
        int x2 = 100;
        System.out.println(-x2++);//-100
        System.out.println(x2);//101
    }
    private static void test1(){
        //位运算
        int i = 2|3;
        int i1 = 2&3;
        int i2 = 2^3;
        int i3 = ~2;
        System.out.println(i+"--"+i1+"--"+i2+"--"+i3);

        int j = 7>>2;//右移相当于对7对2的2次方求余数
        int j1 = 7<<2;//左移相当于7对2的2次方相乘
    }
//    private static void test2(){
//
//    }
//    private static void test3(){
//
//    }
}
